<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>字符串反向输出</title>
</head>

<body>
  <input type="text" id="inputStr" placeholder="请输入字符串">
  <button onclick="reverseString()">反向输出</button>
  <div id="result"></div>
  <script>
    function reverseString() {
      const input = document.getElementById('inputStr').value;
      const reversed = input.split('').reverse().join('');
      document.getElementById('result').innerHTML = `反向后的字符串是：${reversed}`;
    }
  </script>
</body>

</html>